<* include file=$header_file *>

<script type="text/JavaScript">
	if(parent.$('admincpnav')) parent.$('admincpnav').innerHTML='<* $title*>&nbsp;&raquo;&nbsp;Add <* $title*>';if(parent.$('add2custom')) parent.$('add2custom').innerHTML='<* $title*>';
</script>



<script type="text/javascript" src="/js/jquery.js"></script>
<script type="text/javascript" src="/js/jquery.metadata.js"></script>
<script type="text/javascript" src="/js/jquery.validate.js"></script>
<script>

$.metadata.setType("attr", "validate"); // validate for radio or checkbox 

$(document).ready(function() { 
    // validate contact form on keyup and submit 
    $("#contact_form").validate();  
	//alert("last");
}); 
</script>

<form action="/<* $controller *>/opadd" method="post"  name="contact_form" id="contact_form" >
	<table class="tb tb2 ">
		<tr>
			<td colspan="4" class="td27">
			<input class="submit" id="submitbutton" type="submit" value=" Save "/>
			&nbsp;&nbsp;
			<input type="button" value=" Back to list " class="btn" onClick="history.back();"/>
			&nbsp;&nbsp; 
			<input  type="button" value="  Refresh " class="btn" onClick="window.location.reload()"/></td>
		</tr>	
		<tr>
			<th  class="partition" colspan="4">Contact</th>
		</tr>
		<tr>
			<td class="td22 red">Contact Date:</td>
			<td class="vtop ">
				<* html_select_date start_year='-5' end_year='+5' field_order=DMY*>
			</td>
			<td class="td22 red">Contact Time:</td>
			<td class="vtop ">
				<* html_select_time use_24_hours=false display_meridian=true display_seconds=false minute_interval=5 *>	
			</td>
		</tr>	
		<tr>
			<td class="td22 red">Contact Duration:</td>
			<td class="vtop"><input name="Contact_Duration" id="Contact_Duration" size="20" value="" type="text" class="required" /></td>		
			<td class="td22">&nbsp;</td>
			<td class="vtop">&nbsp;</td>				
		</tr>
		<tr>
			<td class="td22 red">Contact Type:</td>
			<td class="vtop ">
				<select class="select required" name="Contact_Type" id="Contact_Type">
					<option value="">Select a Contact Type</option>  		
					<* foreach  from=$field.Contact_Type  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>"><* $field_name *></option>        
					<* /foreach *>
				</select>
			</td>
			<td class="td22 red">Contact Method:</td>
			<td class="vtop ">
				<select class="select required" name="Contact_Method">
					<option value="">Select a Method</option> 				
					<* foreach  from=$field.Contact_Method  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			</td>
		</tr>
		<tr>
			<td class="td22 red">How did you hear about ARAFMI?</td>
			<td class="vtop ">
				<select class="select required" name="Contact_Source">
					<option value="" >Select a Source</option> 				
					<* foreach  from=$field.Contact_Source  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>	
			</td>
			<td class="td22">Program:</td>
			<td class="vtop ">
				<select class="select" name="Contact_Program">
					<option value="" >Select a Contact Program</option> 				
					<* foreach  from=$field.Contact_Program  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>				
			</td>
		</tr>	
		<tr>
			<td class="td22">Referred By:</td>
			<td class="vtop ">
				<select class="select" name="Contact_Referred_By">
					<option value="" >Select a Contact Referred By</option> 				
					<* foreach  from=$field.Contact_Referred_By  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>				
			</td>
			<td class="td22 red">Referred To:</td>
			<td class="vtop ">
				<select class="select required" name="Contact_Referred_To">
					<option value="" >Select a Contact Referred To</option> 				
					<* foreach  from=$field.Contact_Referred_To  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>
			</td>
		</tr>	
		<tr>
			<td class="td22">Contact Outcome:</td>
			<td class="vtop ">
				<select class="select" multiple name="Contact_Outcome[]">				
					<* foreach  from=$field.Contact_Outcome item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>
			<td class="td22 red">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Contact_Notes" id="Contact_Notes" rows="3" value="" class="txt required"></textarea></td>
		</tr>		
		<tr>
			<th  class="partition" colspan="4">Client</th>
		</tr>    
		<tr>
			<td class="td22">First Name:</td>
			<td class="vtop "><input name="Client_First_Name" id="Client_First_Name" value="" type="text" class="txt" /></td>
			<td class="td22">Last Name:</td>
			<td class="vtop "><input name="Client_Last_Name" id="Client_Last_Name" value="" type="text" class="txt" /></td>
		</tr>
		<tr>
			<td class="td22">Address 1:</td>
			<td class="vtop "><input name="Client_Address_1" id="Client_Address_1" value="" type="text" class="txt" /></td>
			<td class="td22">Address 2:</td>
			<td class="vtop "><input name="Client_Address_2" id="Client_Address_2" value="" type="text" class="txt" /></td>
		</tr>		
		<tr>
			<td class="td22">Suburb:</td>
			<td class="vtop "><input name="Client_Suburb" id="Client_Suburb" value="" type="text" class="txt" /></td>
			<td class="td22">State:</td>
			<td class="vtop "><input name="Client_State" id="Client_State" value="" type="text" class="txt" /></td>
		</tr>	
		<tr>
			<td class="td22 red">Postcode:</td>
			<td class="vtop "><input name="Client_Postcode" id="Client_Postcode" size="20" value="" type="text" class="required" /></td>
			<td class="td22 red">Region:</td>
			<td class="vtop ">
				<select class="select required" name="Client_Region">
					<option value="" >Select a Client Region</option> 				
					<* foreach  from=$field.Client_Region  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			</td>			
		</tr>		
		<tr>
			<td class="td22">Age Range:</td>
			<td class="vtop ">
				<select class="select" name="Client_Age_Range">
					<option value="" >Select a Client Age Range</option> 				
					<* foreach  from=$field.Age_Range  item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			</td>			
			<td class="td22 red">Gender:</td>
			<td class="vtop">
				<input type="radio" class="radio" name="Client_Gender" value="0" id="Client_Gender_0" validate="required:true">
				<label for="Client_Gender_0">Male</label>&nbsp;&nbsp;
				<input type="radio" class="radio" name="Client_Gender" value="1" id="Client_Gender_1">
				<label for="Client_Gender_1">Female</label>
				<label for="Client_Gender" class="error">Please select a gender</label>
			</td>									
		</tr>	
		<tr>
			<td class="td22 red">Ethnicity:</td>
			<td class="vtop ">
				<select class="select required" name="Client_Ethnicity">
					<option value="" >Select a Ethnicity</option> 				
					<* foreach  from=$field.Client_Ethnicity item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			</td>
			<td class="td22">Relationship to Consumer:</td>
			<td class="vtop ">
				<select class="select" name="Client_Relationship">
					<option value="" >Select a Relationship to Consumer</option> 				
					<* foreach  from=$field.Client_Relationship item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>				
			</td>			
		</tr>	
		<tr>
			<td class="td22">Member:</td>
			<td class="vtop "><input type="radio" class="radio" name="Client_Member" value="0" id="Client_Member_0"><label for="Client_Member_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Client_Member" value="1" id="Client_Member_1"><label for="Client_Member_1">
			Yes</label></td>
			<td class="td22">Member Branch:</td>
			<td class="vtop ">
				<select class="select" name="Client_Member_Branch">
					<option value="" >Select a Member Branch</option> 				
					<* foreach  from=$field.Branch item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			</td>			
		</tr>	
		<tr>
			<td class="td22">Interests:</td>
			<td class="vtop ">
				<select class="select" multiple name="Client_Interests[]">				
					<* foreach  from=$field.Client_Interests item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>			
			<td class="td22">Other Service Providers:</td>
			<td class="vtop "><textarea cols="50" name="Client_Service_Providers" id="Client_Service_Providers" rows="3" value="" class="txt"></textarea></td>						
		</tr>	
		<tr>
			<td class="td22">Permission to contact:</td>
			<td class="vtop "><input type="radio" class="radio" name="Client_Permission_Contact" value="0" id="Client_Permission_Contact_0"><label for="Client_Permission_Contact_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Client_Permission_Contact" value="1" id="Client_Permission_Contact_1"><label for="Client_Permission_Contact_1">
			Yes</label></td>
			<td class="td22">Privacy information given:</td>
			<td class="vtop "><input type="radio" class="radio" name="Client_Privacy" value="0" id="Client_Privacy_0"><label for="Client_Privacy_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Client_Privacy" value="1" id="Client_Privacy_1"><label for="Client_Privacy_1">
			Yes</label></td>
		</tr>			
		<tr>
			<td class="td22">Interpreter Required:</td>
			<td class="vtop "><input type="radio" class="radio" name="Client_Interpreter" value="0" id="Client_Interpreter_0"><label for="Client_Interpreter_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Client_Interpreter" value="1" id="Client_Interpreter_1"><label for="Client_Interpreter_1">
			Yes</label></td>		
			<td class="td22">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Client_Notes" id="Client_Notes" rows="3" value="" class="txt"></textarea></td>									
		</tr>	
		<tr>
			<th  class="partition" colspan="4">Consumer</th>
		</tr>
		<tr>
			<td class="td22">First Name:</td>
			<td class="vtop "><input name="Consumer_First_Name" id="Consumer_First_Name" value="" type="text" class="txt" /></td>
			<td class="td22">Last Name:</td>
			<td class="vtop "><input name="Consumer_Last_Name" id="Consumer_Last_Name" value="" type="text" class="txt" /></td>
		</tr>
		<tr>
			<td class="td22">Lives with carer:</td>
			<td class="vtop "><input type="radio" class="radio" name="Consumer_Lives_Carer" value="0" id="Consumer_Lives_Carer_0"><label for="Consumer_Lives_Carer_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Consumer_Lives_Carer" value="1" id="Consumer_Lives_Carer_1"><label for="Consumer_Lives_Carer_1">
			Yes</label></td>
			<td class="td22">Drug and Alcohol Issues:</td>
			<td class="vtop "><input type="radio" class="radio" name="Consumer_Drug_Alcohol" value="0" id="Consumer_Drug_Alcohol_0"><label for="Consumer_Drug_Alcohol_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Consumer_Drug_Alcohol" value="1" id="Consumer_Drug_Alcohol_1"><label for="Consumer_Drug_Alcohol_1">
			Yes</label></td>
		</tr>
		<tr>
			<td class="td22 red">Diagnosis:</td>
			<td class="vtop ">
				<select class="select required" name="Consumer_Diagnosis">
					<option value="" >Select a Diagnosis</option> 				
					<* foreach  from=$field.Consumer_Diagnosis item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>				
			</td>
			<td class="td22">Age Range:</td>
			<td class="vtop ">
				<select class="select" name="Consumer_Age_Range">
					<option value="" >Select a Consumer Age Range</option> 				
					<* foreach  from=$field.Age_Range item=field_name key=field_ID *>					
						<option value="<* $field_ID *>" ><* $field_name *></option>        
					<* /foreach *>
				</select>				
			</td>
		</tr>
		<tr>
			<td class="td22">History of Violence:</td>
			<td class="vtop "><input type="radio" class="radio" name="Consumer_Violence" value="0" id="Consumer_Violence_0"><label for="Consumer_Violence_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Consumer_Violence" value="1" id="Consumer_Violence_1"><label for="Consumer_Violence_1">
			Yes</label></td>
			<td class="td22">Risk Assessment:</td>
			<td class="vtop "><input type="radio" class="radio" name="Consumer_Risk" value="0" id="Consumer_Risk_0"><label for="Consumer_Risk_0">
			No</label>&nbsp;&nbsp;<input type="radio" class="radio" name="Consumer_Risk" value="1" id="Consumer_Risk_1"><label for="Consumer_Risk_1">
			Yes</label></td>
		</tr>	
		<tr>
			<td class="td22">Nature of Illness:</td>
			<td class="vtop "><textarea cols="50" name="Consumer_Illness" id="Consumer_Illness" rows="3" value="" class="txt"></textarea></td>			
			<td class="td22">Notes:</td>
			<td class="vtop "><textarea cols="50" name="Consumer_Notes" id="Consumer_Notes" rows="3" value="" class="txt"></textarea></td>						
		</tr>
		
		<tr>
			<td colspan="4" class="td27">
			<input class="submit" id="submitbutton" type="submit" value=" Save "/>
			&nbsp;&nbsp;
			<input type="button" value=" Back to list " class="btn" onClick="history.back();"/></td>
		</tr>
 </table>
 
</form>

<!-- script type="text/javascript" src="/js/crmStaffCheck.js"></script -->

<* include file=$bottom_file *>